package a.g;

import a.c.k;
import a.c.m;
import a.f.c.b;
import a.f.cb;
import a.f.cd;
import a.f.d.gb;
import a.f.d.r;
import a.f.ed;
import a.f.fd;
import a.f.pc;
import a.f.qc;
import a.f.u;
import a.f.vc;
import a.f.y;
import a.h.dc;
import a.h.z;
import a.j.g;
import a.j.*;
import a.j.tb;
import a.f.d.gb;
import a.h.dc;
import a.f.d.r;
import a.h.z;

public class s
  extends h
{
  private static final String q = "EDGE_LABEL_MODEL";
  private static final String r = "EDGE_LABELING";
  private static final String s = "LABELING";
  private static final String t = "REMOVE_FALSE_CROSSINGS";
  private static final String u = "USE_TRANSPOSITION";
  private static final String v = "WEIGHT_HEURISTIC";
  private static final String w = "NODE_ORDER";
  private static final String x = "RANDOMIZATION_ROUNDS";
  private static final String y = "RANKING_POLICY";
  private static final String z = "NODE_RANK";
  private static final String A = "ACT_ON_SELECTION_ONLY";
  private static final String B = "BACKLOOP_ROUTING";
  private static final String C = "EDGE_ROUTING";
  private static final String D = "NODE_PLACEMENT";
  private static final String E = "ORIENTATION";
  private static final String F = "MAXIMAL_DURATION";
  private static final String G = "MINIMAL_EDGE_DISTANCE";
  private static final String H = "MINIMAL_FIRST_SEGMENT_LENGTH";
  private static final String I = "MINIMAL_NODE_DISTANCE";
  private static final String J = "MINIMAL_LAYER_DISTANCE";
  private static final String K = "LAYOUT";
  private static final String L = "HIERARCHIC";
  private static final String M = "FREE";
  private static final String N = "SIDE_SLIDER";
  private static final String O = "CENTER_SLIDER";
  private static final String P = "AS_IS";
  private static final String Q = "BEST";
  private static final String R = "GENERIC";
  private static final String S = "NONE";
  private static final String T = "ORTHOGONAL";
  private static final String U = "POLYLINE";
  private static final String V = "TREE";
  private static final String W = "LINEAR_SEGMENTS";
  private static final String X = "PENDULUM";
  private static final String Y = "MEDIAN";
  private static final String Z = "BARYCENTER";
  private static final String ab = "SIMPLEX";
  private static final String bb = "MEDIAN_SIMPLEX";
  private static final String cb = "TIGHT_TREE";
  private static final String db = "DOWNSHIFT_NODES";
  private static final String eb = "NO_RERANKING";
  private static final String fb = "BFS";
  private static final String gb = "RIGHT_TO_LEFT";
  private static final String hb = "BOTTOM_TO_TOP";
  private static final String ib = "LEFT_TO_RIGHT";
  private static final String jb = "TOP_TO_BOTTOM";
  private static final String kb = "GROUPING";
  private static final String lb = "GROUP_LAYOUT_POLICY";
  private static final String mb = "IGNORE_GROUPS";
  private static final String nb = "LAYOUT_GROUPS";
  private static final String ob = "FIX_GROUPS";
  private static final String pb = "ENABLE_GLOBAL_SEQUENCING";
  private static final String[] qb = { "TOP_TO_BOTTOM", "LEFT_TO_RIGHT", "BOTTOM_TO_TOP", "RIGHT_TO_LEFT" };
  private static final String[] rb = { "NO_RERANKING", "DOWNSHIFT_NODES", "TIGHT_TREE", "SIMPLEX", "AS_IS", "BFS" };
  private static final String[] sb = { "BARYCENTER", "MEDIAN" };
  private static final String[] tb = { "PENDULUM", "LINEAR_SEGMENTS", "POLYLINE", "TREE", "SIMPLEX", "MEDIAN_SIMPLEX" };
  private static final String[] ub = { "POLYLINE", "ORTHOGONAL" };
  private static final String[] vb = { "NONE", "HIERARCHIC", "GENERIC" };
  private static final String[] wb = { "BEST", "AS_IS", "CENTER_SLIDER", "SIDE_SLIDER", "FREE" };
  private a.f.d.d xb;
  public static boolean yb;
  
  public s()
  {
    super("HIERARCHIC", "yFiles Layout Team", "Sugiyama based layout");
    d(true);
  }
  
  public dc j()
  {
    z();
    dc localdc = new dc(a());
    localdc.l("LAYOUT");
    localdc.a("MINIMAL_LAYER_DISTANCE", (int)this.xb.C());
    localdc.a("MINIMAL_NODE_DISTANCE", (int)this.xb.A());
    localdc.a("MINIMAL_EDGE_DISTANCE", (int)this.xb.B());
    localdc.a("MINIMAL_FIRST_SEGMENT_LENGTH", (int)this.xb.D());
    localdc.a("MAXIMAL_DURATION", 5);
    localdc.a("ORIENTATION", qb, 0);
    localdc.a("NODE_PLACEMENT", tb, this.xb.u());
    localdc.a("EDGE_ROUTING", ub, this.xb.a());
    localdc.a("BACKLOOP_ROUTING", false);
    localdc.a("ACT_ON_SELECTION_ONLY", false);
    localdc.l("NODE_RANK");
    localdc.a("RANKING_POLICY", rb, 2);
    localdc.l("NODE_ORDER");
    r localr = new r();
    localdc.a("WEIGHT_HEURISTIC", sb, localr.b());
    localdc.a("USE_TRANSPOSITION", localr.a());
    localdc.a("REMOVE_FALSE_CROSSINGS", this.xb.F());
    localdc.a("RANDOMIZATION_ROUNDS", localr.B());
    localdc.l("LABELING");
    z localz = new z(localdc);
    localz.a(localdc.a("EDGE_LABELING", vb, 0), "NONE", localdc.a("EDGE_LABEL_MODEL", wb, 0), true);
    localdc.l("GROUPING");
    String[] arrayOfString = { "LAYOUT_GROUPS", "FIX_GROUPS", "IGNORE_GROUPS" };
    localdc.a("GROUP_LAYOUT_POLICY", arrayOfString, 0);
    localdc.a("ENABLE_GLOBAL_SEQUENCING", true);
    return localdc;
  }
  
  public void n()
  {
    int i = f.p;
    boolean bool = f.o;
    z();
    g localg = e();
    dc localdc = i();
    this.xb.j(localdc.g("REMOVE_FALSE_CROSSINGS"));
    this.xb.a(localdc.e("MAXIMAL_DURATION") * 1000);
    this.xb.a(localdc.e("MINIMAL_NODE_DISTANCE"));
    this.xb.b(localdc.e("MINIMAL_EDGE_DISTANCE"));
    this.xb.d(localdc.e("MINIMAL_FIRST_SEGMENT_LENGTH"));
    this.xb.c(localdc.e("MINIMAL_LAYER_DISTANCE"));
    cb localcb = (cb)this.xb.h();
    if (i == 0) {
      if (localdc.j("ORIENTATION").equals("TOP_TO_BOTTOM"))
      {
        localcb.a((byte)0);
        if (i != 0) {
          break label263;
        }
        if (!bool) {
          break label248;
        }
      }
    }
    if (i == 0) {
      if (localdc.j("ORIENTATION").equals("LEFT_TO_RIGHT"))
      {
        localcb.a((byte)1);
        if (i != 0) {
          break label263;
        }
        if (!bool) {
          break label248;
        }
      }
    }
    if (i == 0)
    {
      if (localdc.j("ORIENTATION").equals("BOTTOM_TO_TOP"))
      {
        localcb.a((byte)2);
        if (i != 0) {
          break label263;
        }
        if (!bool) {}
      }
      else
      {
        if (i != 0) {
          break label266;
        }
      }
    }
    else if (localdc.j("ORIENTATION").equals("RIGHT_TO_LEFT")) {
      localcb.a((byte)3);
    }
    label248:
    this.xb.l(localdc.e("GROUPING", "ENABLE_GLOBAL_SEQUENCING"));
    label263:
    label266:
    String str1 = localdc.h("EDGE_LABELING");
    if (i == 0)
    {
      if (!str1.equals("NONE")) {
        a(str1, localdc.h("EDGE_LABEL_MODEL"));
      }
    }
    else
    {
      if (i == 0) {
        if (str1.equals("GENERIC"))
        {
          localObject1 = new a.f.e.c();
          ((a.f.e.c)localObject1).f(false);
          ((a.f.e.c)localObject1).g(true);
          ((a.f.e.c)localObject1).h(true);
          ((a.f.e.c)localObject1).a(new qc());
          this.xb.d((vc)localObject1);
          this.xb.c(true);
          if (i == 0) {
            if (!bool) {
              break label462;
            }
          }
        }
        else
        {
          if (i != 0) {
            break label468;
          }
        }
      }
      if (!str1.equals("HIERARCHIC")) {
        break label462;
      }
      localObject1 = new u();
      ((u)localObject1).b(new pc());
      ((u)localObject1).b(new y());
      this.xb.d((vc)localObject1);
      if (i != 0) {
        break label459;
      }
      this.xb.c(true);
      if (!bool) {
        break label462;
      }
    }
    label459:
    this.xb.c(false);
    label462:
    label468:
    Object localObject1 = localdc.h("NODE_PLACEMENT");
    if (i == 0) {
      if (((String)localObject1).equals("PENDULUM"))
      {
        this.xb.c((byte)0);
        if ((i == 0) && (!bool)) {
          break label658;
        }
      }
    }
    if (i == 0) {
      if (((String)localObject1).equals("POLYLINE"))
      {
        this.xb.c((byte)2);
        if ((i == 0) && (!bool)) {
          break label658;
        }
      }
    }
    if (i == 0) {
      if (((String)localObject1).equals("LINEAR_SEGMENTS"))
      {
        this.xb.c((byte)1);
        if ((i == 0) && (!bool)) {
          break label658;
        }
      }
    }
    if (i == 0) {
      if (((String)localObject1).equals("TREE"))
      {
        this.xb.c((byte)3);
        if ((i == 0) && (!bool)) {
          break label658;
        }
      }
    }
    if (i == 0) {
      if (((String)localObject1).equals("SIMPLEX"))
      {
        this.xb.c((byte)4);
        if (i == 0) {
          if (!bool) {
            break label658;
          }
        }
      }
      else
      {
        if (i != 0) {
          break label664;
        }
      }
    }
    if (((String)localObject1).equals("MEDIAN_SIMPLEX")) {
      this.xb.c((byte)5);
    }
    label658:
    label664:
    String str2 = localdc.h("EDGE_ROUTING");
    if (i == 0)
    {
      if (str2.equals("POLYLINE"))
      {
        this.xb.b((byte)0);
        if (i != 0) {
          break label735;
        }
        if (!bool) {}
      }
      else
      {
        if (i != 0) {
          break label741;
        }
      }
    }
    else if (str2.equals("ORTHOGONAL")) {
      this.xb.b((byte)1);
    }
    this.xb.g(localdc.g("ACT_ON_SELECTION_ONLY"));
    label735:
    label741:
    String str3 = localdc.h("RANKING_POLICY");
    if (i == 0) {
      if (str3.equals("AS_IS"))
      {
        this.xb.d((byte)5);
        if ((i == 0) && (!bool)) {
          break label948;
        }
      }
    }
    if (i == 0) {
      if (str3.equals("SIMPLEX"))
      {
        this.xb.d((byte)1);
        if ((i == 0) && (!bool)) {
          break label948;
        }
      }
    }
    if (i == 0) {
      if (str3.equals("NO_RERANKING"))
      {
        this.xb.d((byte)0);
        if ((i == 0) && (!bool)) {
          break label948;
        }
      }
    }
    if (i == 0) {
      if (str3.equals("DOWNSHIFT_NODES"))
      {
        this.xb.d((byte)3);
        if ((i == 0) && (!bool)) {
          break label948;
        }
      }
    }
    if (i == 0) {
      if (str3.equals("TIGHT_TREE"))
      {
        this.xb.d((byte)2);
        if (i == 0) {
          if (!bool) {
            break label948;
          }
        }
      }
      else
      {
        if (i != 0) {
          break label954;
        }
      }
    }
    if (str3.equals("BFS"))
    {
      this.xb.d((byte)4);
      e().a(a.f.d.p.a, ke.c(e()));
    }
    label948:
    label954:
    String str4 = localdc.h("WEIGHT_HEURISTIC");
    gb localgb = this.xb.x();
    if ((i != 0) || ((localgb instanceof r)))
    {
      localr = (r)localgb;
      if (i == 0)
      {
        if (str4.equals("MEDIAN"))
        {
          localr.a((byte)1);
          if (i != 0) {
            break label1046;
          }
        }
      }
      else {
        if (!bool) {
          break label1022;
        }
      }
      localr.a((byte)0);
      label1022:
      localr.a(localdc.g("USE_TRANSPOSITION"));
      localr.c(localdc.c("NODE_ORDER", "RANDOMIZATION_ROUNDS"));
      label1046:
      this.xb.a(localr);
    }
    r localr = null;
    k localk1 = localg.c(ed.a);
    k localk2 = localg.c(ed.b);
    Object localObject2;
    Object localObject3;
    if (i == 0) {
      if (localdc.g("BACKLOOP_ROUTING"))
      {
        localObject2 = null;
        localObject3 = null;
        if (i == 0) {}
        switch (localcb.b())
        {
        case 0: 
          localObject2 = cd.a((byte)2);
          localObject3 = cd.a((byte)1);
          break;
        case 1: 
          localObject2 = cd.a((byte)4);
          localObject3 = cd.a((byte)8);
          break;
        case 3: 
          localObject2 = cd.a((byte)8);
          localObject3 = cd.a((byte)4);
          break;
        case 2: 
          localObject2 = cd.a((byte)1);
          localObject3 = cd.a((byte)2);
        }
        a_ locala_1 = new a_((cd)localObject2, localk1);
        a_ locala_2 = new a_((cd)localObject3, localk2);
        if (i == 0) {
          if (localk1 != null) {
            localg.j(ed.a);
          }
        }
        if (localk2 != null) {
          localg.j(ed.b);
        }
        localg.a(ed.a, locala_1);
        localg.a(ed.b, locala_2);
      }
    }
    if (j.d(localg))
    {
      localObject2 = null;
      if (i == 0) {
        if (localdc.j("GROUP_LAYOUT_POLICY").equals("IGNORE_GROUPS"))
        {
          localObject2 = new a.f.c.c();
          this.xb.a((vc)localObject2);
          break label1374;
        }
      }
      if (localdc.j("GROUP_LAYOUT_POLICY").equals("FIX_GROUPS"))
      {
        localObject3 = new b();
        if (localdc.j("EDGE_ROUTING").equals("ORTHOGONAL")) {
          ((b)localObject3).a((byte)3);
        }
        localObject2 = localObject3;
        this.xb.a((vc)localObject2);
      }
      try
      {
        label1374:
        a(this.xb);
      }
      finally
      {
        if (localObject2 != null) {
          this.xb.c((vc)localObject2);
        }
      }
    }
    else
    {
      a(this.xb);
    }
    if (localdc.g("BACKLOOP_ROUTING"))
    {
      localg.j(ed.a);
      localg.j(ed.b);
      if (i == 0) {
        if (localk1 != null) {
          localg.a(ed.a, localk1);
        }
      }
      if (localk2 != null) {
        localg.a(ed.b, localk2);
      }
    }
    if (localr != null) {
      localg.j(r.G);
    }
    localg.j(a.f.d.p.a);
  }
  
  void a(String paramString1, String paramString2)
  {
    int j = f.p;
    boolean bool = f.o;
    if ((j != 0) || (!paramString1.equals("NONE")))
    {
      if (j != 0) {
        break label45;
      }
      if (!paramString2.equals("AS_IS")) {}
    }
    else
    {
      return;
    }
    label45:
    if (j == 0) {
      if (paramString2.equals("BEST"))
      {
        if (j == 0) {
          if (paramString1.equals("GENERIC"))
          {
            paramString2 = "SIDE_SLIDER";
            if (j != 0) {
              break label99;
            }
            if (!bool) {
              break label97;
            }
          }
        }
        if (j != 0) {
          break label99;
        }
        if (paramString1.equals("HIERARCHIC")) {
          paramString2 = "FREE";
        }
      }
    }
    label97:
    label99:
    byte b1 = 6;
    byte b2 = 32;
    if (j == 0) {
      if (paramString2.equals("CENTER_SLIDER"))
      {
        b1 = 5;
        b2 = 8;
        if ((j == 0) && (!bool)) {
          break label154;
        }
      }
    }
    if (j == 0)
    {
      if (paramString2.equals("FREE")) {
        b1 = 4;
      }
    }
    else {
      b2 = 8;
    }
    label154:
    g localg = e();
    m localm = localg.w();
    do
    {
      if (!localm.e()) {
        break;
      }
      a.c.d locald = localm.a();
      tb localtb = localg.t(locald);
      int i = 0;
      do
      {
        ig localig;
        do
        {
          if (i >= localtb.V()) {
            break;
          }
          localig = localtb.d(i);
        } while (bool);
        if (4 == b1)
        {
          if (j != 0) {
            continue;
          }
          if ((localig.a() instanceof re)) {}
        }
        else
        {
          localig.e(b1);
        }
        a(localig, b2);
        i++;
      } while (!bool);
      localm.f();
    } while (!bool);
  }
  
  public void o()
  {
    this.xb = null;
  }
  
  private void z()
  {
    if ((f.p != 0) || (this.xb == null)) {
      this.xb = new a.f.d.d();
    }
  }
  
  static void a(ig paramig, byte paramByte)
  {
    fd localfd1 = paramig.b();
    if ((f.p != 0) || (localfd1.b() != paramByte))
    {
      fd localfd2 = new fd(localfd1);
      localfd2.b(paramByte);
      paramig.a(localfd2);
    }
  }
  
  static final class a_
    extends a.i.p
  {
    private cd c;
    private k d;
    private static final cd e = cd.a();
    
    a_(cd paramcd, k paramk)
    {
      this.c = paramcd;
      this.d = paramk;
    }
    
    public Object get(Object paramObject)
    {
      int i = f.p;
      if (i == 0) {
        if (this.d != null)
        {
          localObject = this.d.get(paramObject);
          if (i != 0) {
            break label37;
          }
          if (localObject != null) {
            return localObject;
          }
        }
      }
      label37:
      Object localObject = (a.c.d)paramObject;
      if (((a.c.d)localObject).g()) {
        return e;
      }
      return this.c;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.g.s

 * JD-Core Version:    0.7.0.1

 */